import Quick from ".";
import { WeaSelect, WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class Main extends Quick {
    state = {
        value: ''
    }
    getComponent = () => {
        const { value } = this.state;
        return (
            <div>
                <WeaSelect ecId={`${this && this.props && this.props.ecId || ''}_WeaSelect@py7rwd`}
                    style={{ minWidth: 200 }}
                    options={[
                        {key:'submit',showname:getLabel('502502','提交')},
                        {key:'undo',showname:getLabel('32025','撤回')},
                        {key:'save',showname:getLabel('506963','保存')},
                        {key:'distribute',showname:getLabel('33694', '分发')},
                        {key:'export',showname:getLabel(502294,'导出')},
                        {key:'import',showname:getLabel('502835','导入数据')},
                        {key:'cover',showname:getLabel('510797','覆盖')},
                        {key:'reject',showname:getLabel('502287', '退回')},
                        {key:'batchReject',showname:getLabel('506005','批量退回')},
                        {key:'collect',showname:getLabel('510796','强制收集')}
                    ]}
                    value={value}
                    showSearch={true}
                    optionFilterProp="children"
                    onChange={v => this.setState({ value: v })}
                    placeholder={getLabel('527416','选择要隐藏的按钮') }
                />
            </div>
        )
    }
    getTitle = () => {
        return 'excel.hideEdcTaskViewBtn';
    }
    getScript = () => {
        return `excel.hideEdcTaskViewBtn('${this.state.value}');`
    }
}